<?php
$con = mysql_connect('localhost','root','');
$return = mysql_query("show databases");
while($row = mysql_fetch_assoc($return)) {
    var_dump($row);
}
?>